#ifndef MEASURE_H
#define MEASURE_H

#include "settings.h"
#include "sql.h"
#include <QTimer>
#include <QObject>

class Measure : public QObject {
    Q_OBJECT

public:
    Measure(Settings *setting, SQL *sql);
    ~Measure();

    float measureTemp();
    float measureHumi();
    void measureAll();

private:
    unsigned short sensorRead(int fileD);
    void sensorWrite(int fileD, unsigned short command);
    int openDev();
    double decimalPlaces(int intMeasure, double value);

    Settings *mSetting;
    SQL *mSql;
};

#endif
